package com.ruoyi.wjq.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wjq.mapper.WrongQuestionMapper;
import com.ruoyi.wjq.domain.WrongQuestion;
import com.ruoyi.wjq.service.IWrongQuestionService;

/**
 * 错题Service业务层处理
 * 
 * @author wjq
 * @date 2025-08-13
 */
@Service
public class WrongQuestionServiceImpl implements IWrongQuestionService 
{
    @Autowired
    private WrongQuestionMapper wrongQuestionMapper;

    /**
     * 查询错题
     * 
     * @param id 错题主键
     * @return 错题
     */
    @Override
    public WrongQuestion selectWrongQuestionById(Long id)
    {
        return wrongQuestionMapper.selectWrongQuestionById(id);
    }

    /**
     * 查询错题列表
     * 
     * @param wrongQuestion 错题
     * @return 错题
     */
    @Override
    public List<WrongQuestion> selectWrongQuestionList(WrongQuestion wrongQuestion)
    {
        return wrongQuestionMapper.selectWrongQuestionList(wrongQuestion);
    }

    /**
     * 新增错题
     * 
     * @param wrongQuestion 错题
     * @return 结果
     */
    @Override
    public int insertWrongQuestion(WrongQuestion wrongQuestion)
    {
        wrongQuestion.setCreateTime(DateUtils.getNowDate());
        return wrongQuestionMapper.insertWrongQuestion(wrongQuestion);
    }

    /**
     * 修改错题
     * 
     * @param wrongQuestion 错题
     * @return 结果
     */
    @Override
    public int updateWrongQuestion(WrongQuestion wrongQuestion)
    {
        return wrongQuestionMapper.updateWrongQuestion(wrongQuestion);
    }

    /**
     * 批量删除错题
     * 
     * @param ids 需要删除的错题主键
     * @return 结果
     */
    @Override
    public int deleteWrongQuestionByIds(Long[] ids)
    {
        return wrongQuestionMapper.deleteWrongQuestionByIds(ids);
    }

    /**
     * 删除错题信息
     * 
     * @param id 错题主键
     * @return 结果
     */
    @Override
    public int deleteWrongQuestionById(Long id)
    {
        return wrongQuestionMapper.deleteWrongQuestionById(id);
    }
}
